<?php
require_once "lib/db.class.php";
$link = db::getInstance();
$link->conn->query('set names utf8');
extract($_POST);
if($from != "" && $to != "" && $weight != ""){
	$where ="`mean` = (SELECT min(`mean`) FROM `youhao` where ((`start_city` = '".$from."' and `end_city` = '".$to."') or (`start_city` = '".$to."' and `end_city` = '".$from."')) and `weight` = '".$weight."')";
	$fields ='`carstyle`,min(FORMAT(`inf`,2)) as inf,max(FORMAT(`sup`,2)) as sup';
	$res = $link->select2('youhao',$where,$fields);
	print_r(json_encode($res));
}
$link->close();